from typing import (
    Any, Callable, ContextManager, Iterator, List, Literal, NamedTuple, Optional, Sequence, Tuple, TypeVar,
    Union, overload,
)

import torch
from torch import Generator, contiguous_format, inf, strided, SymInt
from torch.types import Device, Number, _bool, _complex, _device, _dtype, _float, _int, _layout, _qscheme, _size
from torchair._ge_concrete_graph import ge_apis as ge
from torchair._ge_concrete_graph.fx2ge_converter import declare_supported, register_fx_node_ge_converter
from torchair.ge._ge_graph import Tensor, TensorSpec
from torchair._ge_concrete_graph.supported_declaration import _TypedTensor, F32, F16, F64, I32, I16, I64, I8, U8, \
    BOOL, Support
from torchair._ge_concrete_graph.utils import dtype_promote


try:
    op = torch._sym_log2
except (ImportError, AttributeError):
    op = None
if op is not None:
    @register_fx_node_ge_converter(torch._sym_log2)
    def conveter_aten_sym_log2(self: Tensor, meta_outputs: TensorSpec = None):
        """NB: aten::_sym_log2(Tensor self) -> Tensor"""
        return ge.Log(self, base=2)